const webpack = require("webpack"),
path = require("path");


module.exports = {
    entry:path.resolve("src","Canvas.js"),
    output:{
        library:"YinduCanvas",
        path:path.resolve("dist"),
        filename:"[name].js",
        libraryTarget:"umd2"
    },
    module:{
        rules:[
            {
                test:/\.js$/,
                include:/src|yindu-*/,
                use:{
                    loader: 'babel-loader',
                    options: {
                        presets: [
                          [
                            '@babel/preset-env',
                            {
                              "targets":"> 0.25%, not dead",
                            }
                          ]
                        ],
                        plugins: [
                            [
                                '@babel/plugin-transform-runtime',
                                {
                                    "helpers": false,
                                    "corejs":false,
                                    "regenerator": true,
                                    "useESModules":false

                                }
                            ],
                            'dynamic-import-webpack'
                        ]
                    }
                }

            }
        ]
    }
}